Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add string representation to log level #49

Closed
wants to merge 7 commits into from

Conversation

leandromoreira
Copy link
Contributor

No description provided.

Copy link
Owner

@asticode asticode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

log.go Outdated
@@ -37,6 +37,11 @@ import "unsafe"

type LogLevel int

// https://github.com/FFmpeg/FFmpeg/blob/release/5.1/libavutil/log.c#L268
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove the comment here?

log.go Outdated
@@ -37,6 +37,11 @@ import "unsafe"

type LogLevel int

// https://github.com/FFmpeg/FFmpeg/blob/release/5.1/libavutil/log.c#L268
func (l LogLevel) String() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this function below constants?

log_test.go Outdated
@@ -19,6 +19,7 @@ func TestLog(t *testing.T) {
lis = append(lis, logItem{
fmt: fmt,
l: l,
lString: l.String(),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove lStrings and instead add require.Equal(t, "error", astiav.LogLevelError) at the top of the test function?

@leandromoreira
Copy link
Contributor Author

I see char *get_level_str(int level) is not exposed through log.h

@leandromoreira
Copy link
Contributor Author

It seems it won't work since is not exposed :(

log.cover.cgo2.c:(.text+0x25e): undefined reference to `get_level_str'

@leandromoreira
Copy link
Contributor Author

I'll close it for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants